import request from '@/utils/request';

/**
 * @author yykk
 * @date: 2022-04-18 21:24:11
 * @desc: 后台日志模块业务
 * @version：1.0.0
 */
export default {
  /**
   *  统计方法的耗时占比
   * @return
   */
  stateLogsMethodversion(time = 100) {
    return request.post("/logs/state/method/" + time);
  },
  /**
   *  统计浏览器占比
   * @return
   */
  stateLogsBrowerversion() {
    return request.post("logs/state/broswer");
  },

  /**
   *  统计操作系统占比
   * @return
   */
  stateLogsOSversion() {
    return request.post("logs/state/os");
  },

  // 1: 查询$搜索&分页后台日志
  findAdminLogsPage(logsVo = {pageNo: 1, pageSize: 10}) {
    return request.post("logs/list", logsVo);
  },

  // 2: 查询后台日志列表
  findAdminLogsList() {
    return request.get("logs/load");
  },

  // 3: 保存&修改后台日志
  saveUpdateAdminLogs(logs = {}) {
    return request.post("logs/saveupdate", logs);
  },

  // 4: 根据id删除后台日志
  delAdminLogs(id) {
    if (!id) {
      return;
    }
    return request.post("logs/delete/" + id);
  },

  // 5: 批量删除后台日志
  delBatchAdminLogs(batchIds) {
    if (!batchIds) {
      return;
    }
    return request.post("logs/delBatch", {batchIds});
  },

  // 6: 根据id查询后台日志明细
  getAdminLogs(id) {
    if (!id) {
      return;
    }
    return request.get("logs/get/" + id);
  },
}
